
$(function() {
	Tip.emp('员工');

	// validate signup form on keyup and submit
	var validator = $("#form_add").validate({
		rules: {
			name: {
				required: true,
				minlength:2
			},
			address: "required"
		},
		messages: {
			name: {
				required: "请输入简称",
				minlength: jQuery.format("请最少输入 {0} 个字符")
			},
			address: "请输入地址"
		},
		// set this class to error-labels to indicate valid fields
		success: function(label) {
			// set &nbsp; as text for IE
			label.html("&nbsp;").addClass("checked");
		}
	});
});

function chkbox_co(form) {
	var len = form.elements.length;
	for ( var i = 0; i < len; i++) {
		var e = form.elements[i];
		if (e.name != 'chkall') {
			e.checked = form.chkall_co.checked;
		}
	}
}